package com.mingqijia.gassafety.shared.constant.runningReport;

public enum ReportNoAuditAlarmStatusEnum {

    ALL(0, "全部"),
    NO_ALARM(1, "无报警（正常运行）"),
    ALARM(2, "存在报警"),
    BROKEN(3, "存在故障"),

    OFFLINE(4, "存在离线");

    private Integer code;
    private String name;

    ReportNoAuditAlarmStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private static final ReportNoAuditAlarmStatusEnum[] VALUES = ReportNoAuditAlarmStatusEnum.values();

    public static ReportNoAuditAlarmStatusEnum matcher(int value) {
        for (ReportNoAuditAlarmStatusEnum ele : VALUES) {
            if (ele.code == value) {
                return ele;
            }
        }
        return null;
    }

    public static String getNameByCode(Integer code) {
        String nameValue = "";
        for (ReportNoAuditAlarmStatusEnum mode : ReportNoAuditAlarmStatusEnum.values()) {
            if (mode.getCode().equals(code)) {
                nameValue = mode.getName();
                break;
            }
        }
        return nameValue;
    }


}
